import request from '@/utils/request'

// 查询vueflow流程列表
export function listFlow(query) {
  return request({
    url: '/vueflow/flow/list',
    method: 'get',
    params: query
  })
}

// 查询vueflow流程列表
export function listFlowGeneral(query) {
  return request({
    url: '/vueflow/flow/general/list',
    method: 'get',
    params: query
  })
}

// 查询vueflow流程详细
export function getFlow(id) {
  return request({
    url: '/vueflow/flow/' + id,
    method: 'get'
  })
}

// 新增vueflow流程
export function addFlow(data) {
  return request({
    url: '/vueflow/flow',
    method: 'post',
    data: data
  })
}

// 修改vueflow流程
export function updateFlow(data) {
  return request({
    url: '/vueflow/flow',
    method: 'put',
    data: data
  })
}

// 删除vueflow流程
export function delFlow(id) {
  return request({
    url: '/vueflow/flow/' + id,
    method: 'delete'
  })
}

//GET   /vueflow/flow/list/all   查询所有流程
export function listAllFlow() {
  return request({
    url: '/vueflow/flow/list/all',
    method: 'get'
  })
}

// Get方法    /vueflow/flow/getRunXml/{id}     获取xml地址   取xmlPath这个字段
export function getRunXml(id) {
  return request({
    url: '/vueflow/flow/getRunXml/' + id,
    method: 'get'
  })
}


//节点树结构GET http://localhost:8080/vueflow/toolCategory/tree
export function getToolCategoryTree() {
  return request({
    url: '/vueflow/toolCategory/tree',
    method: 'get'
  })
}

///update/flow/name/   修改名称 
export function updateFlowName(data) {
  return request({
    url: '/vueflow/flow/update/name',
    method: 'post',
    data: data
  })
}

// /check/xmlPath 校验xml
export function checkXmlPath(data) {
  return request({
    url: '/vueflow/flow/checkXmlPath',
    method: 'post',
    data: data
  })
}